package com.happy3w.ssp.schoolmatehome.component.image;

import lombok.Getter;
import lombok.Setter;

import java.awt.Font;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class DrawPlan {
    private int width;
    private int height;
    private Font font;
    private List<DrawAction> actions = new ArrayList<>();

    public DrawPlan width(int width) {
        this.width = width;
        return this;
    }

    public DrawPlan height(int height) {
        this.height = height;
        return this;
    }

    public DrawPlan font(Font font) {
        this.font = font;
        return this;
    }

    public DrawPlan actions(List<DrawAction> actions) {
        this.actions = actions;
        return this;
    }

    public DrawPlan action(DrawAction action) {
        this.actions.add(action);
        return this;
    }

    public void draw(Canvas canvas) {
        for (DrawAction action : actions) {
            action.draw(canvas);
        }
    }
}
